
import axios from '@/utils/http'

//接口列表
//-----------药品管理
//药品列表
export const drugList='/drugManagement/drugManagement/findDrugList'
//添加
export const addDrug='/drugManagement/drugManagement/addDrug'
//编辑
export const updateDrug='/drugManagement/drugManagement/updateDrug'
//删除
export const delDrug='/drugManagement/drugManagement/delDrug'
//查找
export const searchDrug='/drugManagement/drugManagement/findDrugByCondition'
//出库入库
export const stockChange='/drugManagement/drugManagement/updateDrugNum'


//-----------药品类型
export const drugClassList='/drugManagement/drugManagement/findDrugTypeList'
//添加
export const addDrugType='/drugManagement/drugManagement/addDrugType'
//编辑
export const updateDrugType='/drugManagement/drugManagement/updateDrugType'
//删除
export const deleteDrug='/drugManagement/drugManagement/delDrugType'

//-----------药品库存
export const drugStock='/drugManagement/drugManagement/findDrugTotalList'
export const stockSearch='/drugManagement/drugManagement/selectDrugTotalByCondition'
export const changeRemark='/drugManagement/drugManagement/updateByRemark'



//封装网络请求方法

const medicine={

//-----------药品管理
getMedList(params){
    return axios.get(drugList,{params})
},
addMed(params){
    return axios.post(addDrug,params)
},
editMed(params){
    return axios.post(updateDrug,params)
},
delMed(params){
    return axios.post(delDrug+"?id="+params)
},
searchDrugNormal(con,cur,size){
    return axios.post(searchDrug+"?condition="+con+"&currentPage="+cur+"&pageSize="+size)
},
medStockChange(params){
    return axios.post(stockChange,params)
},
//-----------药品类型
getMedClassList(params){
    return axios.get(drugClassList,{params})
},
addMedicine(params){
    return axios.post(addDrugType,params)
},
editMedicine(params){
    return axios.post(updateDrugType,params)
},
deleteMedicine(params){
    return axios.post(deleteDrug+"?id="+params)
},
//-----------药品库存
getDrugStock(params){
    return axios.get(drugStock,{params})
},
searchDrugStock(con,cur,size){
    return axios.post(stockSearch+"?condition="+con+"&currentPage="+cur+"&pageSize="+size)
},
changeDrugRemark(id,remark){
    return axios.post(changeRemark+"?id="+id+"&remark="+remark)
}
} 




//导出
export default medicine;
